package cn.htsyb.synergy.tester.report;

import cn.htsyb.synergy.tester.report.xdic.TestStatus;
import org.apache.commons.lang.StringUtils;

import java.util.Calendar;
import java.util.Date;
import java.util.List;

public class CaseExtent {
    public String name;
    public String desc;
    public List<CaseExtent> nodeExtent;
    public List<StepExtent> stepExtent;
    public Date startTime;
    public Date endTime;
    public TestStatus status;

    public CaseExtent(String name, String desc) {

    }

    public synchronized CaseExtent createNode(String name, String desc) {
        if (StringUtils.isBlank(name)) {
            throw new IllegalArgumentException("nodeName cannot be null or empty");
        }
        CaseExtent nodeExtent = new CaseExtent(name, desc);
        nodeExtent.startTime(Calendar.getInstance().getTime());
        return new CaseExtent(name, desc);
    }

    private void startTime(Date time) {
        this.startTime = time;
    }

}
